package edu.pdx.cs.cs542s07.minichess;


public class BoardTest {

	public static void main(String[] args) 
		throws IllegalBoardStringException {
		System.out.println("Board one (init)");
		Board board = new Board();
		System.out.println(board);
		System.out.println();
		
		System.out.println("Board two (impossible position)");
		String boardTwo = 	"37 W\n" +
							".....\n" +
							"KQBNR\n" +
							"PPPPP\n" +
							"ppppp\n" +
							"rnbqk\n" +
							".....\n";
		board.fromString(boardTwo);
		System.out.println(board);
		
		System.out.println("Board three (invalid piece)");
		String boardThree = 	"37 W\n" +
							".....\n" +
							"KQBNR\n" +
							"PPPFP\n" +
							"ppppp\n" +
							"rnbqk\n" +
							".....\n";
		try {
			board.fromString(boardThree);
		} catch (IllegalBoardStringException e) {
			System.out.println(e.getMessage());
		}
		System.out.println("Exception successfully caught\n");
		
		System.out.println("Board four (invalid spacer)");
		String boardFour = 	"37 W\n" +
							".. ..\n" +
							"KQBNR\n" +
							"PPPPP\n" +
							"ppppp\n" +
							"rnbqk\n" +
							".....\n";
		try {
			board.fromString(boardFour);
		} catch (IllegalBoardStringException e) {
			System.out.println(e.getMessage());
		}
		System.out.println("Exception successfully caught\n");
		
		System.out.println("Board five (row too long)");
		String boardFive = 	"37 W\n" +
							"......\n" +
							"KQBNR\n" +
							"PPPPP\n" +
							"ppppp\n" +
							"rnbqk\n" +
							".....\n";
		try {
			board.fromString(boardFive);
		} catch (IllegalBoardStringException e) {
			System.out.println(e.getMessage());
		}
		System.out.println("Exception successfully caught\n");
		
		System.out.println("Board six (row too short)");
		String boardSix = 	"37 W\n" +
							".....\n" +
							"KQNR\n" +
							"PPPPP\n" +
							"ppppp\n" +
							"rnbqk\n" +
							".....\n";
		try {
			board.fromString(boardSix);
		} catch (IllegalBoardStringException e) {
			System.out.println(e.getMessage());
		}
		System.out.println("Exception successfully caught\n");
		
	}

}
